﻿<UserControl x:Class="LogInModule.Views.GameInit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:my="clr-namespace:LogInModule.Views"
    xmlns:characterSelection="clr-namespace:LogInModule.Views.GameInicialization"
    mc:Ignorable="d">

    <UserControl.Resources>
        <Style x:Key="SlideTemplate" TargetType="ContentControl">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContentControl">
                        <Grid x:Name="grid" Background="{TemplateBinding Background}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="LayoutStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:1">
                                            <VisualTransition.GeneratedEasingFunction>
                                                <CubicEase EasingMode="EaseOut"/>
                                            </VisualTransition.GeneratedEasingFunction>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="BeforeLoaded">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="2000" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="grid"/>
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="AfterLoaded"/>
                                    <VisualState x:Name="BeforeUnloaded">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="-2000" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="grid"/>
                                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid.RenderTransform>
                                <CompositeTransform/>
                            </Grid.RenderTransform>
                            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch">
        <my:SlideshowControl x:Name="Slideshow" 
                             TransitionStyle="{StaticResource SlideTemplate}"
                             HorizontalAlignment="Stretch"
                             VerticalAlignment="Center">
            <ContentControl x:Name="userLogIn" HorizontalAlignment="Center" />
            <my:GameModeSelection x:Name="gameModeSelection" HorizontalAlignment="Center"/>
            <characterSelection:CharacterSelectionView x:Name="characterSelection" />
            <my:MapSelection x:Name="mapSelection" />

        </my:SlideshowControl>
    </Grid>
</UserControl>
